package cn.panda.edu.teacher;

import cn.panda.edu.model.Store;
import cn.panda.edu.service.StoreService;
import cn.panda.edu.util.ResultDataUtil;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 
 * 类描述：  对题库的CURD操作
 */
@RestController
@RequestMapping(value="/api/teacher/courseware")
public class TeacherStoreController {
	
	//每页显示条数
	final int PAGESIZE=10;
	
	@Autowired
	private StoreService storeService;
	
	/**
	 * 
	* @Title: findAllStore 
	* @Description: TODO 获取所有题库信息
	* @param @return  
	* @return List<Store>
	 */
	@ApiOperation(value="获取题库列表" , notes="")
	@RequestMapping(value = "/store/get", method = RequestMethod.POST)
	public Object findAllStore(Integer pageIndex){
		if(pageIndex==null) {
			pageIndex=1;
		}
		PageInfo<Store> pageInfo=storeService.findAllStore(pageIndex, PAGESIZE);
		return ResultDataUtil.resData(200, "", pageInfo);
	}
}
